import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-oem/oem/invoiceMail/invoice_mail/listByOwn',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

/* 详情 */
export const getDetail = (rimNo) => {
  return request({
    url: '/api/rb-oem/oem/invoiceMail/invoice_mail/detail',
    method: 'get',
    params: {
      rimNo
    }
  })
}

// export const remove = (ids) => {
//   return request({
//     url: '/api/rb-oem/oem/invoiceMail/invoice_mail/remove',
//     method: 'post',
//     params: {
//       ids,
//     }
//   })
// }

/* 添加 */
export const add = (row) => {
  return request({
    url: '/api/rb-oem/oem/invoiceMail/invoice_mail/insert',
    method: 'post',
    data: row
  })
}


/* 导出 */
export const getExport = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: '/api/rb-oem/oem/invoiceMail/invoice_mail/export',
    method: 'get',
    params: {
      ...params,
    }
  })
}

/* 导出模板 */
export const getExportTemplate = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: 'api/rb-oem/oem/invoiceMail/invoice_mail/export-template',
    method: 'get',
    params: {
      ...params,
    }
  })
}
/* 注意事项 */
export const getNote = () => {
  return request({
    url: '/api/rb-oem/oem/invoiceMail/invoice_mail/detailNotice',
    method: 'get'
  })
}

// 发票类型
export const invoiceType = () => {
  return request({
    url: '/api/blade-system/dict/dictionary?code=invoice_type',
    method: 'get'
  })
}
// 流 -------单条数据审核
export const adminOne = (row) => {
  return request({
    url: '/api/rb-oem/oem/invoiceMail/invoice_mail/adminOne',
    method: 'post',
    data: row
  })
}
